﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TekaMUD.Engine.Behaviour;
using TekaMUD.Engine.Framework;

namespace TekaMUD.Engine.Blocks
{
	/// <summary>
	/// Placeholder for storing money.
	/// </summary>
	public class Money : GameObject, IUncountable
	{
		public decimal Quantity {get; set;}

		public Money()
		{
			this.Name = "coins";
			this.LookDescription = "some money coins";
			this.Synonyms = new string[] { "gold", "coin", "coins", "money", "cash" };
		}

		public override string LookDescription
		{
			get
			{
				if (Quantity > 0)
				{
					return "There are " + Quantity + " " + (Quantity == 1 ? "coin" : "coins") + " here";
				}
				else
				{
					Logger.LogWarning("Uncountable object reached zero but kept alive. ID: " + this.ToString());
					
					// Notify the container?"

					return "There is no money left!";
				}
			}
		}

		public override string PluralizedNoun
		{
			get
			{
				return "money";
			}
		}

		public EnumUnitType Unit
		{
			get { return EnumUnitType.Coins; }
		}
	}
}
